<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
namespace App\Observers;

use App\Models\User;
use App\Service\User\UserServices;
use Illuminate\Support\Facades\DB;

class UserObserver
{
    /**
     * Handle the User "created" event.
     */
    public function created(User $user)
    {
        DB::table('users')->where('id', $user->getKey())->update((['uuid' => id_encode($user->getKey())]));
        UserServices::make()->InitUserAccount($user);
    }

    /**
     * Handle the User "updated" event.
     */
    public function updated(User $user)
    {
    }

    /**
     * Handle the User "deleted" event.
     */
    public function deleted(User $user)
    {
    }

    /**
     * Handle the User "restored" event.
     */
    public function restored(User $user)
    {
    }

    /**
     * Handle the User "force deleted" event.
     */
    public function forceDeleted(User $user)
    {
    }
}
